const path = require('path');
module.exports = appInfo => {
    const config = {};
    config.keys = appInfo.name + '_1537176394102_7101';
    config.view = {
        root: [
      path.join(appInfo.baseDir, 'app/view'),
      path.join(appInfo.baseDir, 'path/to/another'),
    ].join(','),
        defaultViewEngine: 'nunjucks',
        mapping: {
            '.tpl': 'nunjucks',
        },
    };

    // 跨域配置
    config.cors = {
        origin: '*',
        allowMethods: 'GET,HEAD,PUT,POST,DELETE,PATCH'
    };
    config.security = {
        csrf: {
            ignoreJSON: true, // 默认为 false，当设置为 true 时，将会放过所有 content-type 为 `application/json` 的请求
        },
        methodnoallow: {
            enable: false
        },
        domainWhiteList: ['localhost:8080','huruqing.cn','huruqing.cn:7001']
    }
    return config;
};
